//
//  StatusForwardCell.swift
//  JJWeibo
//
//  Created by JJ on 15/9/8.
//  Copyright © 2015年 JJ. All rights reserved.
//

import UIKit

class StatusForwardCell: StatusCell {
    
   override var statusViewModel:StatusViewModel?{
        
        didSet{
            let forwordText = statusViewModel?.forwordText ?? ""
            forwardLable.attributedText = EmoticonViewModel.shareViewModel.emoticonText(forwordText, font: forwardLable.font)
        }
    }
    
    
    override func setUI(){
        super.setUI()
        contentView.insertSubview(backButton, belowSubview: pictureView)
        contentView.insertSubview(forwardLable, aboveSubview: backButton)
        
        backButton.ff_AlignVertical(type: ff_AlignType.BottomLeft, referView: contenLable, size: nil, offset: CGPoint(x: -JJStatusCellMargin, y: JJStatusCellMargin))
       backButton.ff_AlignVertical(type: ff_AlignType.TopRight, referView: bottomView, size: nil)
        
        forwardLable.ff_AlignInner(type: ff_AlignType.TopLeft, referView: backButton, size: nil, offset: CGPoint(x: JJStatusCellMargin, y: JJStatusCellMargin))
        
        let cons = pictureView.ff_AlignVertical(type: ff_AlignType.BottomLeft, referView: forwardLable, size: CGSize(width: JJStatusPictureMaxWidth, height: JJStatusPictureMaxWidth), offset: CGPoint(x: 0, y: JJStatusCellMargin))
        pictureViewWidthCons=pictureView.ff_Constraint(cons, attribute: NSLayoutAttribute.Width)
        pictureViewheightCons=pictureView.ff_Constraint(cons, attribute: NSLayoutAttribute.Height)
        pictureViewTopCons=pictureView.ff_Constraint(cons, attribute: NSLayoutAttribute.Top)

    }
    

    private lazy var backButton:UIButton={
       let button=UIButton()
        button.backgroundColor=UIColor(white: 0.9, alpha: 1.0)
        return button
    }()
    
    private lazy var forwardLable:UILabel=UILabel(title: "转发微博转发微博转发微博转发微博转发微博转发微博转发微博转发微博", color: UIColor.darkGrayColor(), fontsize: 14, layoutWidth: UIScreen.mainScreen().bounds.width - 2 * JJStatusCellMargin)

}
